#ifndef CCPPDATA_H
#define CCPPDATA_H

/* 简单的示例，该类为QML提供数据
 * 定时发出信号，QML绑定这个信号，收到信号时通过接口获取数据进行展示
*/
#include <QObject>
#include <QDateTime>
#include <QTimer>
#include <QImage>

class CCppData : public QObject
{
    Q_OBJECT
public:
    explicit CCppData(QObject *parent = nullptr);

    Q_INVOKABLE QDateTime currentDateTime() const{
        return QDateTime::currentDateTime();
    }

signals:
    void currentTimeChanged();

protected:
    void timerEvent(QTimerEvent *event) override;
};

#endif // CCPPDATA_H
